package com.test.Page;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class BaiduLoginPage {

    public static String SetUpButton_xpath="//span[text()='设置']/following-sibling::a[@name='tj_login']";
    public static String UserNameInput_xpath="//input[@id='TANGRAM__PSP_11__userName']";
    public static String PassWordInput_xpath="//input[@id='TANGRAM__PSP_11__password']";
    public static String LoginSubmitButton_xpath="//input[@id='TANGRAM__PSP_11__submit']";

    public  void login( WebDriver driver,String username,String password) throws InterruptedException {
        driver.findElement(By.xpath("//span[text()='设置']/following-sibling::a[@name='tj_login']")).click();
        Thread.sleep(2000);

        driver.findElement(By.xpath("//input[@id='TANGRAM__PSP_11__userName']")).sendKeys(username);
        driver.findElement(By.xpath("//input[@id='TANGRAM__PSP_11__password']")).sendKeys(password);
        Thread.sleep(2000);
        driver.findElement(By.xpath("//input[@id='TANGRAM__PSP_11__isAgree']")).click();//接受协议
        driver.findElement(By.xpath("//input[@id='TANGRAM__PSP_11__submit']")).click();//登录


    }

}
